home *** CD-ROM | disk | FTP | other *** search
- H & T are a bit thin on the ground this month because this issue is
- being finished before Christmas so I get some time off and it’s only a
- couple of weeks since I closed the December issue, so not much has come
- in yet. Most of the H & T that we have got were sent in by Anton Carver.
- Thanks Anton!
-
- 2.4
- • Using function keys − If you want to get the function keys to
- produce ASCII codes, say, 200, 201, 202 etc, you use *FX 225,200 but
- this only works for keys <f0> (the print key) to <f9>. If you want to
- use <f10> upwards, you need to use *FX 221,200. This also makes <insert>
- into the equivalent of <f13> i.e. it generates, in this case, ASCII 213.
- 2.4
- • Troubles with Mitsubishi Drives? − Yes, there are problems with some
- of the new 5.25” Mitsubishi drives with some of the 5.25” disc inter
- faces, but they can be solved. The problem is the use of pin 2 on the
- interface. It was not used on the BBC micro, but on the new Mitsubishi
- drives it is used for DC interrupt. The solution is to put a little bit
- of masking tape on the edge connector inside the drive mechanism so that
- it doesn’t make contact with the p.c.b. Pin 2 is on the top of the board
- at the outside edge.
- 2.4
- • Programmable reset − A hang-over from the BBC micro is that if you
- program function key 10, you will find that if you press <reset>,
- function key 10 will be executed! If you don’t know about this, it can
- come as something of a shock, but it could be that you would want to
- make use of it if you were, say, developing a machine code program which
- kept hanging up the machine and forcing you to press <reset>. You could
- program it as *KEY 10 *BASIC|MOLD|MEDIT .|M and it would jump you back
- into editing the program at the point where you were.
- 2.4
- • Is it still going? − If you are doing some heavy machine code
- programming and want to know if the computer is still working or whether
- you have locked it up completely, try pressing the caps lock and/or
- scroll lock keys and if they are still responding, your computer’s not
- dead yet! The caps and scroll lock LED’s are controlled by the computer
- in response to the key presses, so if they are working, it tells you
- that the processor is still reponding to interrupts.
- 2.4
- • Using ARMBE − It is useful to be able to enter ARMBE at the point of
- the last error. Here is a program which sets up function key 4 so that
- it enters ARMBE at the point where the error occurred or, if no error
- then it enters where you were last editing by using “EDIT .”.
- 2.4
- 10 *set key$edit IF ERL=0 THEN OSCLI (|“KEY 4 *FIXKEY4||mEDIT . ||m|”)
- ELSE OSCLI(|“KEY 4 *FIXKE Y4||mEDIT |” + STR$(ERL) + |“||m |”)|mMISTAKE
- |m*FX138,0,132|m
- 2.4
- 20 *set alias$fixkey4 set key$4 |<key$edit>
- 2.4
- 30 *fixkey4
- 2.4
- • REM’s − Although the User Guide says that REM statements are ignored
- by BASIC, this is not completely true in BASIC V. This is because the
- block conditional IFÉTHENÉELSEÉ ENDIF requires the THEN to be the last
- statement on the line. Adding a REM to the end of the line will change
- the flow of control, thus:
- 2.4
- >LIST
- 2.4
- 10 OK%=TRUE
- 2.4
- 20 IF NOT OK% THEN
- 2.4
- 30 PRINT “Wrong!”
- 2.4
- 40 ELSE
- 2.4
- 50 PRINT “Right”
- 2.4
- 60 ENDIF
- 2.4
- >RUN
- 2.4
- Right
- 2.4
- >LIST
- 2.4
- 10 OK%=TRUE
- 2.4
- 20 IF NOT OK% THEN :REM Danger!
- 2.4
- 30 PRINT “Wrong!”
- 2.4
- 40 ELSE
- 2.4
- 50 PRINT “Right”
- 2.4
- 60 ENDIF
- 2.4
- >RUN
- 2.4
- Wrong!
- 2.4
- • MODE3/6 gaps − There is an undocumented difference between the way
- that the gaps between lines are coloured in the 25-row modes. In modes 3
- and 6, the gaps are the border colour and in modes 11, 14 and 17, they
- are the background colour.
- 2.4
- By experimenting with SWI“OS_ReadMode Variable”, I discovered that bit 3
- of variable 0 (Modeflags) indicates the condition. If the bit is set to
- 0, the gaps will be background colour and if 1 they are border colour,
- thus:
- 2.4
- 10 For mode%=0 TO 17
- 2.4
- 20 MODE mode%
- 2.4
- 30 VDU 10,0,24,128,0|
- 2.4
- 40 SYS“OS_ReadModeVariable”
- 2.4
- ,MODE,0 TO ,,modeflag%
- 2.4
- 50 PRINT “Mode= ”;MODE
- 2.4
- 60 IF (modeflag% AND (1<<3))
- 2.4
- <>0 THEN t$=“Border” ELSE t$=“Background”
- 2.4
- 70 IF (modeflag% AND (1<<2))
- 2.4
- <>0 THEN t$=“No”
- 2.4
- 80 PRINT t$;“ gaps”
- 2.4
- 90 wait%=GET
- 2.4
- 100 NEXT
- 2.4
- • Auto linefeed − Some software packages, like First Word Plus for
- instance, insist that you set your printer so that it does not generate
- auto-matic linefeeds. This means that if you list a BASIC program with
- lines that are longer than the carriage length, the line wraps round and
- is overprinted. To avoid this and the difficulty of fiddling with dip
- switches, use the BASIC command WIDTH before printing. To do this, type
- WIDTH <carriage length> (e.g. WIDTH 80) before printing and WIDTH 0 to
- reset to the default setting after printing.
- 2.4
-